﻿using System;
using System.Text.RegularExpressions;

namespace ExtractURL
{
    class ExtractURL
    {
        static void Main(string[] args)
        {
            string text = "Here is the link:<br>[URL=http://www.t3lerik.com]Telerik[/URL]<br>\n" +
                          "and the logo:[URL=http://www.telerik.com][IMG]\n http://www.telerik.com/logo.png[/IMG][/URL]\n";
            Regex pattern = new Regex(@"www\.[\w\d]+\.[\w]{2,4}(/[\w\d]+\.[\w]{2,4})*");

            MatchCollection matches = pattern.Matches(text);
            foreach (Match match in matches)
            {
                Console.WriteLine("{0}", match.Value);
            }
        }
    }
}